package com.SunSoft.PhoneRemoteControl;

import android.app.AlertDialog.Builder;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;

final class ex
  implements AdapterView.OnItemSelectedListener
{
  public final void onItemSelected(AdapterView paramAdapterView, View paramView, int paramInt, long paramLong)
  {
    int i = 0;
    if (i >= Show_Search.k(this.a).length)
      return;
    if (Show_Search.l(this.a)[paramInt].equals(Show_Search.k(this.a)[i].c))
      if (i == 11)
      {
        paramAdapterView = Show_Search.f(this.a).rawQuery("select ID,control_type,name_ch,name_en,brand_ch,brand_en,control_model,define_ID, device_ID from control_list where control_type = ?  order by ID", new String[] { "11" });
        if (paramAdapterView.getCount() <= 0)
          break label490;
        i = paramAdapterView.getCount();
        Show_Search.a(this.a, new fq[i]);
        Show_Search.a(this.a, new String[i]);
        paramInt = 0;
        if (paramAdapterView.moveToNext());
      }
    label490: for (paramInt = i; ; paramInt = 0)
      while (true)
      {
        while (true)
        {
          paramAdapterView.close();
          if (paramInt <= 0)
            break;
          new AlertDialog.Builder(this.a).setTitle(this.a.getString(2131099652)).setIcon(17301659).setSingleChoiceItems(Show_Search.n(this.a), 0, new ey(this)).setNegativeButton(this.a.getString(2131099654), new ez(this)).show();
          return;
          Show_Search.m(this.a)[paramInt] = new fq(this.a);
          Show_Search.m(this.a)[paramInt].a = paramAdapterView.getString(paramAdapterView.getColumnIndex(this.a.o));
          Show_Search.m(this.a)[paramInt].f = paramAdapterView.getString(paramAdapterView.getColumnIndex(this.a.n));
          Show_Search.m(this.a)[paramInt].b = paramAdapterView.getInt(paramAdapterView.getColumnIndex("ID"));
          Show_Search.m(this.a)[paramInt].c = paramAdapterView.getString(paramAdapterView.getColumnIndex("define_ID"));
          Show_Search.m(this.a)[paramInt].d = paramAdapterView.getString(paramAdapterView.getColumnIndex("device_ID"));
          Show_Search.n(this.a)[paramInt] = paramAdapterView.getString(paramAdapterView.getColumnIndex(this.a.o));
          paramInt += 1;
        }
        this.a.ag = 5;
        this.a.af = this.a.ag;
        this.a.b(this.a.af);
        Show_Search.o(this.a).setSelection(this.a.af - 1);
        return;
        this.a.ag = i;
        this.a.b(i);
        return;
        i += 1;
      }
  }

  public final void onNothingSelected(AdapterView paramAdapterView)
  {
  }
}